package com.yin.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

import com.yin.entity.UserEntity;
import com.yin.event.UserEmainEvent;
import com.yin.event.UserRegisterEvent;

/**
*@author LSY
*Time: 2018年12月28日上午10:06:50
*
*
*/
@Service
public class UserService {

	@Autowired
	ApplicationContext applicationContext;
	
	public void register(UserEntity userEntity) {
		//发布UserRegisterEvent事件
		applicationContext.publishEvent(new UserRegisterEvent(this, userEntity));
		applicationContext.publishEvent(new UserEmainEvent(this, userEntity));
	}
}
